package com.zhouyx.eurekaclient.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @ClassName DcController
 * @Description TODO
 * @Author za-zhouyunxing
 * @Date 2018/5/17 13:57
 * @Version 1.0
 */
@RestController
public class DcController {
    @Autowired
    DiscoveryClient discoveryClient;

    @GetMapping("/dc")
    public String dc() throws InterruptedException {
        //TimeUnit.SECONDS.sleep(5);
        String services = "Services: " + discoveryClient.getServices();
        System.out.println(services);
        return services;
    }
}
